using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;

namespace PSE.Hosting.ServiceHoster.Configuration
{
    /// <summary>
    /// Represents a single assembly hosted by the BM&FBOVESPA Service Hoster
    /// </summary>
    internal class AssemblyConfigurationElement : ConfigurationElement
    {
        #region Constructors

        /// <summary>
        /// Creates a new instance of the 
        /// <see cref="PSE.Hosting.ServiceHoster.Configuration.AssemblyConfigurationElement"/> class.
        /// </summary>
        public AssemblyConfigurationElement()
        {
        }

        /// <summary>
        /// Creates a new instance of the 
        /// <see cref="PSE.Hosting.ServiceHoster.Configuration.AssemblyConfigurationElement"/> class.
        /// </summary>
        /// <param name="name">The assembly name.</param>
        /// <param name="codeBase">The assembly code base.</param>
        /// <param name="domain">The domain name for the user.</param>
        /// <param name="userName">The user name used to impersonate assembly operations.</param>
        /// <param name="password">The user password.</param>
        public AssemblyConfigurationElement(string fileName, string codeBase, string fullName)
        {
            this.FileName = fileName;
            this.CodeBase = codeBase;
            this.FullName = fullName;

        }

        /// <summary>
        /// Creates a new instance of the 
        /// <see cref="PSE.Hosting.ServiceHoster.Configuration.AssemblyConfigurationElement"/> class.
        /// </summary>
        /// <param name="name">The assembly name.</param>
        public AssemblyConfigurationElement(string fileName)
        {
            this.FileName = fileName;
        }

        #endregion

        #region Public Members

        /// <summary>
        /// The assembly name file name (The file name without full path).
        /// </summary>
        [ConfigurationProperty("fileName", IsKey = true)]
        public string FileName
        {
            get { return (string)this["fileName"]; }
            set { this["fileName"] = value; }
        }

        /// <summary>
        /// The assembly code base *The file name with full path).
        /// </summary>
        [ConfigurationProperty("codeBase", IsRequired = true)]
        public string CodeBase
        {
            get { return (string)this["codeBase"]; }
            set { this["codeBase"] = value; }
        }

        /// <summary>
        /// The assembly code base *The file name with full path).
        /// </summary>
        [ConfigurationProperty("fullName", IsRequired = true)]
        public string FullName
        {
            get { return (string)this["fullName"]; }
            set { this["fullName"] = value; }
        }



        #endregion
    }
}
